package com.md.model.request.authentication.users;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.md.annotation.validation.PasswordCheck;
import com.md.aspectj.DefaultValueAspectj;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author 刘骄阳
 * 2022-09-22 21:29
 */
@Data
@ApiModel("注册用户请求实体")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RegisterUsersRequest {
  /**
   * 用户名
   */
  @ApiModelProperty("用户名")
  @NotBlank(message = "用户名不能为空!")
  private String name;

  /**
   * 密码
   */
  @ApiModelProperty(value = "密码", notes = "密码必须为8-12位字符")
  @PasswordCheck(message = "密码必须为8-12位字符,请重新输入!")
  private String password;
  /**
   * 头像
   */
  @ApiModelProperty("头像")
  private String headIcon;

  /**
   * 手机号
   */
  @ApiModelProperty("手机号")
  private String phone;

  /**
   * 验证码
   */
  @ApiModelProperty("验证码")
  private String code;

  public RegisterUsersRequest() {
    DefaultValueAspectj.buildDefaultValue(this);
  }
}
